Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
from "p" to a "list"

Good day!

I am using WordPress and this plugin outputs products in one p tag and separates them with a semicolon as in the image.

I was wondering if it is possible somehow to take the values of that p tag and output them in a list? One under the other?

Or perhaps this is a JavaScript question? Or maybe even I should fiddle with the WordPress plugin itself?

I will appreciate any help or hints!

Thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You could use a simple script like this to extract the text content of p, separate each entry after each semicolon and map with p tags:

const parent = document.querySelector("dd.variation-bundledProducts")

const elems = document.querySelector("dd.variation-bundledProducts p").textContent.split(";").map(el => `<p>${el}</p>`).join("");

parent.innerHTML = elems
<dd class="variation-bundledProducts">
  <p>
    element1; element2; element3; element4
  </p>
</dd>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!